<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改证书申请')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-apply-edit" th:object="${sslApply}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">颁发机构：</label>
                    <div class="col-sm-8">
                        <select name="issuingAuthority" class="form-control" th:with="type=${@dict.getType('lssuing_authority')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{issuingAuthority}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">证书域名：</label>
                    <div class="col-sm-8">
                        <textarea name="certificateDomain" class="form-control" required>[[*{certificateDomain}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">私钥类型：</label>
                    <div class="col-sm-8">
                        <select name="privateKeyType" class="form-control" th:with="type=${@dict.getType('private_key_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{privateKeyType}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">证书私钥：</label>
                    <div class="col-sm-8">
                        <textarea name="certificatePrivateKey" class="form-control">[[*{certificatePrivateKey}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">ACME账户：</label>
                    <div class="col-sm-8">
                        <input name="acmeId" th:field="*{acmeId}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">获取挑战的地址：</label>
                    <div class="col-sm-8">
                        <textarea name="authorizations" class="form-control">[[*{authorizations}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">验证是否已经验证了域名所有权接口api地址：</label>
                    <div class="col-sm-8">
                        <input name="finalize" th:field="*{finalize}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">证书下载地址：</label>
                    <div class="col-sm-8">
                        <input name="fileDownload" th:field="*{fileDownload}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">状态：</label>
                    <div class="col-sm-8">
                        <select name="status" class="form-control" th:with="type=${@dict.getType('ssl_status')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "SSL/apply";
        $("#form-apply-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-apply-edit').serialize());
            }
        }
    </script>
</body>
</html>